package com.yy.device.boot.protocol;

import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 注册信息
 *
 * @author sunzhiqiang
 * @date 2022/03/03 11:58:51
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class RegisterMessage extends Message {

    private byte head;
    private byte version;
    private short length;
    private int deviceCode;
    private short crc;
    private byte end;

    @Override
    public void decode(ByteBuf byteBuf) {
        this.setDeviceCode(byteBuf.readIntLE());
        this.setCrc(byteBuf.readShortLE());
    }

}
